using System;
using Preparation;


namespace Tester.GuiActions.Actions.Impl
{
    public class MoveSelectedUpAction : BaseAction
    {
        public override bool Visible
        {
            get
            {
                return
                    TesterMultyDocument.Instance != null && 
                    TesterMultyDocument.Instance.Suspended == TesterMultyDocument.SuspendStates.Stopped&&
                    (TesterList.Instance != null &&  TesterList.Instance.SelectedItems.Count > 0) &&
                    TesterMainForm.Instance.TopControl == EmbededControlTags.TesterList;

            }
        }

        public override void MainAction(object sender, EventArgs e)
        {
            if (Visible)
            {
                TesterList.Instance.SortBySelection();
            }
        }

    }
}
